﻿@model SchoolManagerMVC.Web.Areas.Students.ViewModels.StudentCreationViewModel

@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Student Information</legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.student.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.student.FirstName)
            @Html.ValidationMessageFor(model => model.student.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.student.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.student.LastName)
            @Html.ValidationMessageFor(model => model.student.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.student.Age)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.student.Age)
            @Html.ValidationMessageFor(model => model.student.Age)
        </div>
    </fieldset>
    
    <fieldset>
            <legend>Account Information</legend>

            <div class="editor-label">
                @Html.LabelFor(m => m.registerModel.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.registerModel.UserName)
                @Html.ValidationMessageFor(m => m.registerModel.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.registerModel.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.registerModel.Email)
                @Html.ValidationMessageFor(m => m.registerModel.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.registerModel.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.registerModel.Password)
                @Html.ValidationMessageFor(m => m.registerModel.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.registerModel.ConfirmPassword)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.registerModel.ConfirmPassword)
                @Html.ValidationMessageFor(m => m.registerModel.ConfirmPassword)
            </div>
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
